package com.osce.system.service;

import com.osce.common.core.entity.entity.SysMilitaryUser;
import com.osce.interfaces.system.ISysMilitaryUserService;
import com.osce.system.mapper.SysMilitaryUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 军人用户信息扩展表Service业务层实现
 *
 * @author admin
 * @since 2024-11-02
 */
@Service
public class SysMilitaryUserServiceImpl implements ISysMilitaryUserService {
    @Autowired
    private SysMilitaryUserMapper sysMilitaryUserMapper;

    /**
     * 通过用户ID查询军人用户信息
     *
     * @param userId 用户ID
     * @return 军人用户信息
     */
    @Override
    public SysMilitaryUser selectSysMilitaryUserByUserId(Long userId) {
        return sysMilitaryUserMapper.selectSysMilitaryUserByUserId(userId);
    }

    /**
     * 新增军人用户信息
     *
     * @param militaryUser 军人用户信息
     * @return 结果
     */
    @Override
    public int insertSysMilitaryUser(SysMilitaryUser militaryUser) {
        return sysMilitaryUserMapper.insertSysMilitaryUser(militaryUser);
    }

    /**
     * 修改军人用户信息
     *
     * @param militaryUser 军人用户信息
     * @return 结果
     */
    @Override
    public int updateSysMilitaryUser(SysMilitaryUser militaryUser) {
        return sysMilitaryUserMapper.updateSysMilitaryUser(militaryUser);
    }

    /**
     * 删除军人用户信息
     *
     * @param userId 用户ID
     * @return 结果
     */
    @Override
    public int deleteSysMilitaryUserByUserId(Long userId) {
        return sysMilitaryUserMapper.deleteSysMilitaryUserByUserId(userId);
    }
}